package com.example.springboot_vue.controller;


import com.example.springboot_vue.common.CommonDto;
import com.example.springboot_vue.common.PageDto;
import com.example.springboot_vue.entity.RecordEntity;
import com.example.springboot_vue.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sgp
 * @since 2024-07-22
 */
@RestController
@RequestMapping("/record")
public class RecordController {

    @Autowired
    private RecordService recordService;

    @GetMapping("/getList")
    public CommonDto getList(RecordEntity recordEntity){
        CommonDto<PageDto<RecordEntity>> commonDto = new CommonDto<>();
        PageDto<RecordEntity> pageDto= recordService.getList(recordEntity);
        commonDto.setContent(pageDto);
        return commonDto;
    }

}
